<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="../JavaScript/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
  <div>
  <form id="form">
  <table>
  <tr><th><h1>添加库存信息</h1></th></tr>
  <tr><td>操作类型：</td>
      <td><select name="opType">
      			  <option  value="入库">入库</option>
                  <option  value="出库">出库</option>
          </select></td></tr>
  <tr><td>存储化妆品：</td>
	  <td><select name="cosmeticId">
	        <c:forEach var="cos" items="${lc}">
	        	<option value="${cos.cosmeticId}">${cos.cosmeticName}</option>
	        </c:forEach>
	      </select>
	  </td></tr>
  <tr><td>操作个数：</td><td><input type="text" name="depotCount"/></td></tr>
  <tr><td><input type="button" value="添加" id="add"/></td></tr>
  </table>
  </form>
  </div>
  <script type="text/javascript">
  	$("#add").click(
  		function () {
  		$.ajax({
  			type:"post",
  			url:"savedep",
  			data:$("#form").serialize(),
  			success:function(data){
  				alert("添加成功！");
  			}
  		});
  	});
  </script>
</body>
</html>